
(function($, owner) {
	owner.initRefresh = function(idname, refreshFun, loadingMsg, loadEndMsg,pulldownRefresh) {
		loadingMsg = loadingMsg ? loadingMsg : '正在加载...';
		loadEndMsg = loadEndMsg ? loadEndMsg : '没有更多数据了';
		$.init({
			pullRefresh: {
				container: idname,
				up: {
					contentrefresh: loadingMsg,
					contentnomore: loadEndMsg,
					callback: refreshFun
				} 
			}
		});
		/*是否初始化就执行下拉刷新*/
		if($.os.plus) {
			$.plusReady(function() {
				setTimeout(function() {
					$(idname).pullRefresh().pullupLoading(); 
				}, 100);
			});
		} else {
			/*$.ready(function() {
				$(idname).pullRefresh().pullupLoading();
			});*/
		}
	},
	owner.ajaxGetData = function(url, type, data, callback, params,failcallback) {
		data = data ? data : [];
		type = type ? type : 'GET'; //默认类型为GET
		params = params ? params : '';
		ajaxFun.postFun(url,data,params,callback,failcallback);
	}
}(mui, window.newRefresh = {}))

